home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BMUG Revelations
/
BMUG Revelations.toast
/
Utilities
/
Text and Speech
/
BBEdit 2.2.2
/
BBEdit Extensions
/
Sources
/
DialogUtilities.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-09-08
|
1KB
|
62 lines
#include "DialogUtilities.h"
Handle GetIHandle(DialogPtr d, short item)
{
Rect r;
Handle h;
short iType;
GetDItem(d, item, &iType, &h, &r);
return h;
}
void SetStrItem(DialogPtr d, short item, unsigned char s[])
{
Handle h = GetIHandle(d, item);
SetIText(h, s);
}
void ReadStrItem(DialogPtr d, short item, unsigned char s[])
{
Handle h = GetIHandle(d, item);
GetIText(h, s);
}
void SetDlgCtl(DialogPtr d, short item, Boolean flag)
{
ControlHandle c = (ControlHandle)GetIHandle(d, item);
SetCtlValue(c, flag);
}
Boolean GetDlgCtl(DialogPtr d, short item)
{
ControlHandle c = (ControlHandle)GetIHandle(d, item);
return GetCtlValue(c);
}
Boolean TestDlgCtl(DialogPtr d, short item)
{
ControlHandle c = (ControlHandle)GetIHandle(d, item);
return ((**c).contrlHilite != 0xFF);
}
void XAbleDlgCtl(DialogPtr d, short item, Boolean flag)
{
ControlHandle c = (ControlHandle)GetIHandle(d, item);
HiliteControl(c, flag ? 0 : 0xFF);
}
void SetupUserItem(DialogPtr d, short item, pascal void (*ItemProc)(DialogPtr d, short item))
{
short type;
Handle handle;
Rect rect;
GetDItem(d, item, &type, &handle, &rect);
SetDItem(d, item, type, (Handle)ItemProc, &rect);
}